package standardt;

import javax.annotation.security.RolesAllowed;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import com.grape.dao.base.StandardRepository;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class Grape1 {

	@Autowired
	private StandardRepository sr;

	@Test // 没有实现的dao层借口，好玄幻，sql也可以，太玄幻了
	public void test1() {
		System.out.println(sr.findByName("10-20公斤"));
		System.out.println(sr.sqlByName("10-20公斤"));
	}

	@Test // 修改 
	@Transactional
	@Rollback(false)
	public void test2() {
		sr.update(1, 20);
	}
	
	
	
	@Test // 
	public void test() {

	}

}
